<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset={$charset}" />
	<title>{$page_title}</title>
	<link type="text/css" rel="stylesheet" href="view/css/layout.css"/>
	{if isset($css)}<link type="text/css" rel="stylesheet" href="{$css}"/>{/if}		
	<link rel="alternate" type="application/rss+xml" title="rss" href="?page=rss" />
</head>
<body>

{if isset($action)}
	{if $action==="login"}
	<fieldset>
		<legend>Logg inn</legend>
		<form method="post" action="?page=auth&amp;type=login">
			<label for="user">Brukernavn:</label><input type="text" id="user" name="username" />
			<label for="pwd">Passord:</label><input type="password" id="pwd" name="password" />
			<input type="hidden" value="{$page}" name="from" />
			<input type="submit" value="Ok" />
		</form>
	</fieldset>
	{elseif $action==="reg"}
	<fieldset>
		<legend>Registrer bruker</legend>
		<form method="post" action="?page=auth&amp;type=reg">
			<label for="user">Brukernavn:</label><input type="text" id="user" name="username" />
			<label for="pwd">Passord:</label><input type="password" id="pwd" name="password" />
			<label for="email">E-post:</label><input type="text" id="email" name="email" />
			<input type="hidden" value="{$page}" name="from" />
			<input type="submit" value="Ok" />
		</form>
	</fieldset>
	{/if}
{else}
	{if isset($user)}
		<p>Du er logget på som {$user}</p>
		<a href="?page={$page}&amp;action=logout">Logg av</a> 
	{elseif $reg==yes}
	//Nothing
	{else}
		<a href="?page={$page}&amp;action=login">Logg på</a>
		<a href="?page={$page}&amp;action=reg">Registrer</a>
	{/if}
{/if}

{if isset($message)}<p class="error">{$message}</p>{/if}

<h1>Tour Builder</h1>

{include file="$content_tpl"}

{* footer *}

</body>
</html>